package demo;
//class A {
//    public int a = 10;
//    public int b = 1;
//    public void show1() {
//        System.out.println("父类");
//    }
//
//}
//class B extends A {
//    public int a = 20;
//    public void show1() {
//        System.out.println("子类的");
//    }
//
//    public void show() {
//        super.show1();
//        System.out.println("B子类");
//    }
//    public void eat() {
//        System.out.println("eat");
//    }
//}
//
//class C extends A {
//    public void show() {
//        System.out.println("C子类");
//    }
//}
//
//class Dad {
//    public void print() {
//        System.out.println("父类的print()");
//    }
//    public void show() {
//        System.out.println("父类的show()");
//    }
//}
//class Son extends Dad {
//    public void show() {
//        System.out.println("子类的show()");
//    }
//}
class Graph {
    public void draw() {
        System.out.println(" ");
    }
}
class Triangle extends Graph {
    public void draw() {
        System.out.println("△");
    }
}
class Square extends Graph {
    public void draw() {
        System.out.println("□");
    }
}
class Pentagram extends Graph {
    public void draw() {
        System.out.println("☆");
    }
}
public class Test {
    public static void fun(Graph graph) {
        graph.draw();
    }
    public static void main(String[] args) {
        Graph triangle = new Triangle();
        Graph square = new Square();
        Graph pentagram = new Pentagram();
        fun(triangle);
        fun(square);
        fun(pentagram);
    }
}

